Repository navigation
Conversation
`isSubRowSelected` returns `false` both when a row's selectable descendants are all unselected and when it has no selectable descendants at all. A parent treated both the same way, so a sub-row whose children are all unselectable marked the parent as "not all selected", even when every selectable descendant was selected. Track the "no selectable descendants" case separately in the recursion and skip those subtrees, so `row.getIsAllSubRowsSelected()` and `row.getIsSomeSelected()` only look at rows that can be selected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 052ba98 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
🎯 Changes
When a sub-row's descendants are all unselectable, the parent row treats that sub-row as "not all selected". So after selecting every row that can be selected, the parent still reports a partial selection, and its checkbox renders as indeterminate.
Cause:
isSubRowSelectedreturnsfalsein two different cases: a subtree that has selectable rows but none are selected, and a subtree that has no selectable rows at all. Since #6491, a parent counts both as "not all selected". This affects table-core 9.0.0 through 9.3.1; v8 handled the second case correctly.Fix: the recursion now goes through a private helper that returns
undefinedwhen a subtree has no selectable rows, and the parent skips those subtrees.isSubRowSelectedkeeps its signature and return values.Updated test:
should return some if no children are selectable, but a grand-child is and is selectedexpected'some'. In that setup the only selectable descendant is selected; the result was'some'only because a sibling subtree with no selectable rows was counted as unselected. That contradicts the JSDoc ("all selectable descendants are selected") and the existing testshould return all if all selectable sub-rows are selected, so it now expects'all'and is renamed accordingly.Added one implementation test and one unit test for the row methods; all three fail without the fix.
✅ Checklist
pnpm testandpnpm test:e2e, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit